package com.ruoyi.consumer.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.consumer.mapper.CWalletCompanyMapper;
import com.ruoyi.consumer.domain.CWalletCompany;
import com.ruoyi.consumer.service.ICWalletCompanyService;

/**
 * 公司钱包Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-10-29
 */
@Service
public class CWalletCompanyServiceImpl implements ICWalletCompanyService 
{
    @Autowired
    private CWalletCompanyMapper cWalletCompanyMapper;

    /**
     * 查询公司钱包
     * 
     * @param walletPersonId 公司钱包主键
     * @return 公司钱包
     */
    @Override
    public CWalletCompany selectCWalletCompanyByWalletPersonId(Integer walletPersonId)
    {
        return cWalletCompanyMapper.selectCWalletCompanyByWalletPersonId(walletPersonId);
    }

    /**
     * 查询公司钱包列表
     * 
     * @param cWalletCompany 公司钱包
     * @return 公司钱包
     */
    @Override
    public List<CWalletCompany> selectCWalletCompanyList(CWalletCompany cWalletCompany)
    {
        return cWalletCompanyMapper.selectCWalletCompanyList(cWalletCompany);
    }

    /**
     * 新增公司钱包
     * 
     * @param cWalletCompany 公司钱包
     * @return 结果
     */
    @Override
    public int insertCWalletCompany(CWalletCompany cWalletCompany)
    {
        cWalletCompany.setCreateTime(DateUtils.getNowDate());
        return cWalletCompanyMapper.insertCWalletCompany(cWalletCompany);
    }

    /**
     * 修改公司钱包
     * 
     * @param cWalletCompany 公司钱包
     * @return 结果
     */
    @Override
    public int updateCWalletCompany(CWalletCompany cWalletCompany)
    {
        cWalletCompany.setUpdateTime(DateUtils.getNowDate());
        return cWalletCompanyMapper.updateCWalletCompany(cWalletCompany);
    }

    /**
     * 批量删除公司钱包
     * 
     * @param walletPersonIds 需要删除的公司钱包主键
     * @return 结果
     */
    @Override
    public int deleteCWalletCompanyByWalletPersonIds(Integer[] walletPersonIds)
    {
        return cWalletCompanyMapper.deleteCWalletCompanyByWalletPersonIds(walletPersonIds);
    }

    /**
     * 删除公司钱包信息
     * 
     * @param walletPersonId 公司钱包主键
     * @return 结果
     */
    @Override
    public int deleteCWalletCompanyByWalletPersonId(Integer walletPersonId)
    {
        return cWalletCompanyMapper.deleteCWalletCompanyByWalletPersonId(walletPersonId);
    }
}
